#!/usr/bin/env python3
# -*- coding: utf-8 -*-


import itertools

"""
无限迭代器



"""


def count():
    naturals = itertools.count(1)
    for i in naturals:
        print(i)


# cycle()会把传入的一个序列无限重复下去：
def cycle():
    cy = itertools.cycle("ABC")
    for i in cy:
        print(i)


# repeat()负责把一个元素无限重复下去
def repeat():
    ns = itertools.repeat('A', 3)
    for i in ns:
        print(i)

# count()
# cycle()
repeat()